﻿//jQuery.noConflict();
var cstId="";
var EmpID="";
var Service_url="";
var imgData=[{},{},{},{},{},{}];
var flag=new Array();
var result=[];
var result2=[[],[],[],[]];
var result3=new Array();
$(function(){  
	
  var cli_label = new Addclassname('.label_radio','r_on');
  cli_label.addc();
	
showLeft(".sr",".sr_link","sr_hover");
DownShow("#Map area",".area_city","")
clickshow(".click",".show_div","click_hover")
clickshow(".buyforme_btn",".buyforme_box","")
clickshow(".list_share_box",".share_box","")
clickshow(".click",".show_div","click_hover")
clickshow2(".insurance_sort",".more_insurance","")
//clickshow2(".title_find_style li",".find_detail","first")
clickshow2(".select_this",".jijin_context_message","select_this")
clickshow2(".label_click",".other_detail","icoo")
clickshow3(".tab5",".life_tab_detail","life_tab_hover")
clickshow3(".tab5",".insurance_tab_detail","life_tab_hover")
tabshow(".tab1_a",".tab1_show","tab_hover")
tabshow(".tab1_a2",".tab1_show2","tab_hover")
tabshow(".tab2_title",".tab2_show","tab2_hover")
tabshow(".tab3_a",".tab3_show","tab3_hover")
tabshow(".box_tab a",".box_tab_detail","hover")
tabshow(".zz_top_lii",".showj_r","hover")
tabshow(".zz_top_li",".zz_info","hover")
tabshow(".small_tab a",".small_tab_box","on")
//tabshow(".vcc-index_tab_main li",".vcc-index_tab_main_div_div","se")
tabshow(".vcc-index_tab_main :eq(0)  li",".vcc-index_tab_main_div :eq(0) .vcc-index_tab_main_div_div ","se")//保险首页
tabshow(".vcc-index_tab_main :eq(1)  li",".vcc-index_tab_main_div :eq(1) .vcc-index_tab_main_div_div ","se")//保险首页
tabshow(".vcc-index_tab_main_crd li",".vcc-index_tab_main_crd_box .yzgh_box_main_main_content ","se")//信用卡首页
tabshow(".conment .finance-tag ul li",".conment .tab_1","hover")//私人银行首页
tabshow(".conment .finance-tag_1 ul li",".conment .pro_li","hover")//私人银行首页
menushow(".company_nav_a",".company_nav_detail","company_nav_a_hover")
menushow(".nav>ul>li",".mnavL","hover")
menushow(".Business_a",".Business_text","")
clickshow5("#kefu",".kefu",".jhjt","#button2",".white_content3","se")
clickshow5("#jhjt",".jhjt",".kefu",".but2",".white_content3","se")
clickshow5("#white_content3",".white_content3",".kefu",".btn3",".jhjt","se")
clickhide(".sd_sn",".search_nav","")
clickhide(".close_city",".select_hide","")
clickhide(".close_box",".buyforme_box01","")
clickhide(".close_box02",".buyforme_box02","")

menushow3("#suspend")
clickhide3(".btn_close","#fadee",".susp_show","#suspend")
clickhide3("#fadee","#fadee",".susp_show","#suspend")
clickshow6(".susp_nav>ul>li",".susp_show .susp_l li.sus",".susp_show .susp_r","#fadee","#suspend",".susp_show","hover")
clickshow7(".susp_show .susp_l li.sus",".susp_show .susp_r","hover") 
clickBox(".index_scroll_bottom",".index_scroll_down","index_scroll_bottom_up")
mapshow(".map_style a")
$("#kefu").click(function(){
       $(".kefu .zxkf_con label:contains(专属客户经理)").remove();
	   var cscid = $.cookie('cs_cid');
	   if(cscid!=null && cscid!='')
	   {queryIdParam();}	
});

function DownShow(obj1,obj2,cl){
	var index,id,timer,divcreate;
	divcreate=false;
	$(obj1).hover(
	function(){
	  
		id=$(obj1).index(this);
		$(obj1).removeClass(cl);
		$(this).addClass(cl);
		hidecur();
		$(obj2).eq(id).stop(true,true).delay(500).slideDown(100, function(){});
		divcreate=true;
		index=id;
		
		
	},function(){
		id=$(obj1).index(this);
		divcreate=false;
		hidecur();
		$(obj1).removeClass(cl);
	})
	$(obj2).hover(
	function(){divcreate=true;hidecur();},function(){id=$(obj2).index(this);divcreate=false;hidecur();});
	function hidecur(){
		clearTimeout(timer);
		if(index!=id){$(obj2).eq(index).stop(true,true).delay(50).fadeOut("fast", function(){});	}
		timer=setTimeout(function(){
		if(!divcreate){
		$(obj2).eq(id).stop(true,true).delay(50).fadeOut("fast", function(){});	
		};
		},100);	
	}
}


function showLeft(obj1,obj2,cl){
	var index,id,timer,divcreate;
	divcreate=false;
	$(obj1).hover(
	function(){
		id=$(obj1).index(this);
		$(obj1).removeClass(cl);
		$(this).addClass(cl);
		hidecur();
		$(obj2).eq(id).stop(true,true).delay(50).toggle({width: 158},400, function(){});
		divcreate=true;
		index=id;
		
	},function(){
		id=$(obj1).index(this);
		divcreate=false;
		hidecur();
		$(obj1).removeClass(cl);
	})
	$(obj2).hover(function(){divcreate=true;hidecur();},function(){id=$(obj2).index(this);divcreate=false;hidecur();});
	function hidecur(){
		clearTimeout(timer);
		if(index!=id){$(obj2).eq(index).stop(true,true).delay(50).fadeOut("fast", function(){});	}
		timer=setTimeout(function(){
		if(!divcreate){
		$(obj2).eq(id).stop(true,true).delay(50).fadeOut("fast", function(){});	
		};
		},500);	
	}
	
	
}


function clickshow(obj1,obj2,cl)
{
	var id;
	$(obj2).hide();
	$(obj1).click(function(){
	id=$(obj1).index($(this));	
	$(obj1).removeClass(cl);
	$(this).addClass(cl);
	
	$(obj2).eq(id).delay(50).slideDown(200, function(){});
	})	
	$(obj2+":first").hide();
}

function clickshow2(obj1,obj2,cl)
{
	var id;
	$(obj1).click(function(){
	id=$(obj1).index($(this));	
	$(obj1).removeClass(cl);
	$(this).addClass(cl);
	$(obj2).hide();
	$(obj2).eq(id).show();
	})
}

function clickshow3(obj1,obj2,cl)
{
	var id;
	$(obj1).click(function(){
	id=$(obj1).index($(this));	
	$(obj1).removeClass(cl);
	$(this).addClass(cl);
	$(obj2).hide();
	$(obj2).eq(id).show();
	})
	$(obj2+":first").show();
}
function clickshow4(obj1,obj2,cl)
{
	var id;
	$(obj1).click(function(){
	id=$(obj1).index($(this));	
	$(obj2).addClass(cl);
	$(obj1).hide();
	$(obj2).show();
	})
}
function clickshow5(obj1,obj2,obj3,obj4,obj5,cl){
	

	$(obj1).parent().removeClass(cl);
	$(obj1).click(function(e){
	e.stopPropagation();
	$(this).parent().addClass(cl).siblings().removeClass(cl);;
	$(obj2).show();
	$(obj3).hide();
	$(obj5).hide();	

	})
	
	$(obj4).click(function(){
	
	$(obj1).parent().removeClass(cl);
	$(obj2).hide();
	
	
})	
	$(obj1).parent().removeClass(cl);
	$(obj2).hide();



$(document).bind("click",function(e){ 
var target = $(e.target); 
if(target.closest(obj2).length == 0){ 
$(obj1).parent().removeClass(cl);
$(obj2).hide(); 
} 
}) 

}

function clickBox(obj1,obj2,cl)
{
	//var id;
	$(obj1).click(function(e){
	//id=$(obj1).index($(this));	
    e.stopPropagation();
	if($(this).attr('state')==0){
		$(".index_scroll_box").animate({ height: "652px" }, 300);
		$(obj1).each(function(){ 
			$(this).html($(this).attr("text"));
			$(this).removeClass(cl);
        }); 
		$(this).html("收起");
		$(this).addClass(cl);
		$(obj1).attr("state","0");
		$(this).attr("state","1");
		$(this).next().slideDown(300);
		$(this).parent().siblings().find(obj2).slideUp(300);
		$(".index_scroll").css("z-index","9")
	}
	else{
		$(".index_scroll_box").animate({ height: "120px" }, 300);
		$(this).html($(this).attr("text"));
		$(this).removeClass(cl);
		$(this).attr("state","0");
		$(this).next().slideUp(300);
	}
	
})
$(document).bind("click",function(e){ 

        $(obj1).each(function(e){ 
			if($(this).attr('state')==1){
			  $(".index_scroll_box").animate({ height: "120px" }, 300);
              $(this).html($(this).attr("text"));
              $(obj1).attr("state","0");
              $(obj2).slideUp(300);
		      $(obj1).removeClass(cl); 
			}
       }); 	 
		  });	
	
			 //点按钮/链接后层收起

		  $(obj2).find(".a_link , input[type=button] , button").on("click", function(e){
			   $(obj1).each(function(e){ 
			if($(this).attr('state')==1){
			  $(".index_scroll_box").animate({ height: "120px" }, 300);
              $(this).html($(this).attr("text"));
              $(this).attr("state","0");
              $(obj2).slideUp(300);
		      $(obj1).removeClass(cl); 
			}
	
		 });
		 });
        
		$(obj2).click(function(e){
		e.stopPropagation();
		 });
	
}
function clickshow6(obj1,obj2,obj3,obj4,obj5,obj6,cl)
{	var id;
 var screen_w=window.screen.width;
 var div_w;
 if(screen_w>960){
	 div_w=(screen_w-960)/2+960;
 }else{
	div_w=960;
 
 }
 
$(obj1).click(function() {
	id=$(obj1).index($(this));	
	$(obj1).removeClass(cl);
	$(obj2).eq(id).addClass(cl);
	$(obj3).hide();
	$(obj3).eq(id).show();	
	$(obj5).hide();
		$(obj4).show();
        $(obj6).stop();
        $(obj6).animate({width: div_w}, 400);
	
	
    });

}

function clickshow7(obj1,obj2,cl)
{	var id;
 var screen_w=window.screen.width;
 var div_w=(screen_w-960)/2+960;
$(obj1).click(function() {
	id=$(obj1).index($(this));	
	$(obj1).removeClass(cl);
	$(obj1).eq(id).addClass(cl);
	$(obj2).hide();
	$(obj2).eq(id).show();	
    });
}



function clickhide3(obj1,obj2,obj3,obj4)
{
	
	$(obj1).click(function() {
		$(obj2).hide();
		$(obj3).animate({width:"0"}, 100);
		$(obj4).show();
		$(obj4).animate({width:"40px"}, 400);
		
	});
	}




function hoverb2(obj1,obj2,cl)
{
	var id;
	
	$(obj1).mouseover(function(){
	id=$(obj1).index($(this));	
	//alert(id);
	$(obj1).removeClass(cl);
	$(this).addClass(cl);
	$(obj2).hide();
	//$(obj2).toggle(400);
	$(obj2).eq(id).show();
	})	
	//$(obj2+":first").show();
}



hoverb2(".susp_l ul li.sus",".susp_show .susp_r","hover");
hoverb2(".susp_tit2 ul li.sus-li1",".susp_cont2","hover");
hoverb2(".susp_tit3 ul li.sus-li2",".susp_cont3","hover_susp");




function clickhide(obj1,obj2,cl)
{
	var id;
	$(obj1).click(function(){
	id=$(obj1).index($(this));	
	$(obj1).removeClass(cl);
	$(this).addClass(cl);
	$(obj2).hide();
	$(obj2).eq(id).delay(50).slideUp(200, function(){});
	})	
	
}
function clickhide2(obj1,obj2,obj3)
{
	//var id;
	$(obj1).click(function(){
	//id=$(obj1).index($(this));	
	//$(obj1).removeClass(cl);
	//$(this).addClass(cl);
	$(obj2).hide();
	//$(obj2).eq(id).delay(50).slideUp(200, function(){});
	$(obj3).show();
	})	
}

function tabshow(obj1,obj2,cl)
{
	var id;
	$(obj1).mouseover(function(){
	id=$(obj1).index($(this));	
	$(obj1).removeClass(cl);
	$(this).addClass(cl);
	$(obj2).hide();
	$(obj2).eq(id).show();
	})	
	$(obj2+":first").show();
}

// 首页bannerli添加
hovershow(".D1fBt")
function hovershow(obj1)
{
	$(obj1).hover(function(){
	$(obj1).find("span").stop();
	 $(obj1).find("span").animate({ height: "48px" }, 300);
		},function(){
			$(obj1).find("span").stop();
	 $(obj1).find("span").animate({ height: "0px" }, 300);
		})
}

function menushow(obj1,obj2,cl){
	var index,id,timer,divcreate;
	divcreate=false;
	$(obj1).hover(
	function(){
		id=$(obj1).index(this);
		$(obj1).removeClass(cl);
		$(this).addClass(cl);
		hidecur();
		$(obj2).eq(id).stop(true,true).delay(400).slideDown(200, function(){});
		divcreate=true;
		index=id;
		
	},function(){
		id=$(obj1).index(this);
		divcreate=false;
		hidecur();
		$(obj1).removeClass(cl);
	})
	$(obj2).hover(function(){divcreate=true;hidecur();},function(){id=$(obj2).index(this);divcreate=false;hidecur();});
	function hidecur(){
		clearTimeout(timer);
		if(index!=id){$(obj2).eq(index).stop(true,true).delay(50).fadeOut("fast", function(){});	}
		timer=setTimeout(function(){
		if(!divcreate){
		$(obj2).eq(id).stop(true,true).delay(50).fadeOut("fast", function(){});	
		};
		},100);	
	}
	
}

function menushow2(obj1,obj2,cl)
{	var index,id,timer,divcreate;
	divcreate=false;
	$(obj1).hover(
	function(){
		id=$(obj1).index(this);
		$(obj1).removeClass(cl);
		$(this).addClass(cl);
		hidecur();
		$(obj2).eq(id).stop(true,true).delay(200).slideDown(200, function(){});
		divcreate=true;
		index=id;
		
	},function(){
		id=$(obj1).index(this);
		divcreate=false;
		hidecur();
		$(obj1).removeClass(cl);
	})
	$(obj2).hover(function(){divcreate=true;hidecur();},function(){id=$(obj2).index(this);divcreate=false;hidecur();});
	function hidecur(){
		clearTimeout(timer);
		if(index!=id){$(obj2).eq(index).stop(true,true).delay(50).fadeOut("fast", function(){});	}
		timer=setTimeout(function(){
		if(!divcreate){
		$(obj2).eq(id).stop(true,true).delay(50).fadeOut("fast", function(){});	
		};
		},100);	
	}
}

	
	$(".must_input").blur(function(){
		if($(this).val()=="")
		{
			$(this).addClass("input_error");		
		}
		else
		{
			$(this).removeClass("input_error");
			$(this).removeClass("no_focus");
		}
	});
	
	//提交时验证
	$("#get_code").click(function(){
		$(".must_input").each(function()
			{
				$(this).trigger("blur");
			})
		if($(".input_error").size()>0||$(".no_focus").size()>0)
			{return false;}
		else{
			$(".banner2:eq(0)").hide();
			$(".section:eq(0)").hide();
			$(".banner2:eq(1)").show();
			$(".section:eq(1)").show();
			//$("#cutdown").attr("disabled", true);
            //$("#cutdown").val("剩余120秒");
			//$("#cutdown").removeClass("reget");
			
			var count = 120;
			CountDown();
            var countdown = setInterval(CountDown, 1000);
			function CountDown() {
                    $("#cutdown").attr("disabled", true);
                    $("#cutdown").val("剩余" + count + "秒");
					$("#cutdown").removeClass("reget");
                    if (count == 0) {
                        $("#cutdown").removeAttr("disabled");
						$("#cutdown").val("重新获取");
						$("#cutdown").addClass("reget");
                        clearInterval(countdown);
                    }
                    count--;
                }
		
		}			
	});
	
	function menushow3(obj1){
 $(obj1).mouseover(function() {
      $(this).stop();
        $(this).animate({width: "120px"}, 400); 
		
    });
	$(obj1).mouseout(function(){
      $(this).stop();
        $(this).animate({width: "40px"}, 400);  
    });
	
}
	
	$(".must_input2").blur(function(){
		if($(this).val()=="")
		{
			$(this).addClass("input_error");		
		}
		else
		{
			$(this).removeClass("input_error");
			$(this).removeClass("no_focus2");
		}
	});
	
	//提交时验证
	$("#nxte_sure").click(function(){
		$(".must_input2").each(function()
			{
				$(this).trigger("blur");
			})
		if($(".input_error").size()>0||$(".no_focus2").size()>0)
			{return false;}
		else{
			$(".banner2:eq(1)").hide();
			$(".section:eq(1)").hide();
			$(".banner2:eq(2)").show();
			$(".section:eq(2)").show();
		}	
				
	});
	
	
	$("#pwd").blur(function(){
		if($(this).val()=="")
		{
			$(".show_ts").addClass("show_ts_red");
			$(".content_right .show_ts").html("请输入新密码");	
		}
		else
		{
			$(".show_ts").removeClass("show_ts_red");
			$(".content_right .show_ts").html("请用英文字母（区分大小写）、数字、符号组成，6-16个字符，请勿使用<span>简单密码</span>");
		}
	});
	
	$("#last_4").blur(function(){
		if($(this).val()=="")
		{
			$(".get_code").removeClass("reget");	
		}
		else
		{
			$(".get_code").addClass("reget");
		}
	});
	
	$(".save_change").click(function(){
		if($(this).parent().parent().prev().find(".login_input").val()=="")
		{
			return false;
		}
		else
		{
			$(this).parent().parent().parent().hide();
			$(this).parent().parent().parent().next().show();
		}
	});
	
	$(".phone_prove").click(function(){
		$(this).parent().parent().parent().parent().parent().hide();
		$(this).parent().parent().parent().parent().parent().next().hide();
		$(this).parent().parent().parent().parent().parent().next().next().show();
	});
	
	$(".change_data").click(function(){
		$(".title1").show();
		$(".title1").siblings().hide();
		$(".title1").next().show();
		$(".title1:eq(1)").next().next().show();
	});
	
	$(".tab_radio").find(".label_radio:last").css("margin-right","0px");
	$(function(){
		$(".select_list").click(function(){
			$(this).find(".select_ul").toggle();
		})
		$(".select_list").mouseleave(function(){
			$(this).find(".select_ul").hide();
		});
		
		$(".select_list .select_ul ul li").click(function(){
			$(this).parents(".select_list").find(".select_value").text($(this).text());
		});
	})
	/*
	$(".login_input").blur(function(){
		if($(this).val()==""){
			$(this).parent().parent().find(".error span").show();
			$(this).addClass("input_error");
		}
		else{
			$(this).parent().parent().find(".error span").hide();
			$(this).removeClass("input_error");
		}
	})*/
	$(".show_code_icon").keyup(function(){
		if($(this).val().length==5){
			if($(this).val()=="right"){
				$(this).parent().parent().find(".input_icon .right").show();
			    $(this).parent().parent().find(".input_icon .wrong").hide();
			}
			else{
				$(this).parent().parent().find(".input_icon .right").hide();
			    $(this).parent().parent().find(".input_icon .wrong").show();
			}
		}
		else{
			$(this).parent().parent().find(".input_icon .right").hide();
			$(this).parent().parent().find(".input_icon .wrong").hide();
		}
	})
	$(".login_input").keyup(function(){
		if($(this).val()==""){
			$(this).next().show();
		}
		else{
			$(this).next().hide();
		}
	})
	
	
	$(".index_scroll_bottom").click(function(){
		var divh=(document.body.scrollTop || document.documentElement.scrollTop);
		if(divh<300){
			$("html, body").animate({ scrollTop:300}, 500);
		}
		else{
			return false;
		}
    })
	
	//根据href传值判断隐藏
	var falg=window.location.search;
	falg=falg.substring(1);
	var arr=falg.split('=');
	if(arr[1]=='email'){
		$(".title_find_style li:eq(0)").removeClass("first");
		$(".title_find_style li:eq(1)").addClass("first");
		$(".find_detail:eq(0)").hide();
		$(".find_detail:eq(1)").show();
	}
function InsertAdvs(id,img){
      var num=id+2;
	  var link= getAdvUrl('1010'+num,'s','iframe','');
      $.ajax({  
	        async:true, 
			cache:false,
		    timeout:1500,
			type:"get",
			url:link+'&callback'+num+'=jsonpCallback',
			dataType:"jsonp",
			jsonp:"callback1010"+num, 
			jsonpCallback:"callback1010"+num, 
			success:function (data){ 
			       if(!imgData[id].imgsrc){ 
				     imgData[id]={imgsrc:data.imgsrc,href:data.href,acqadid:data.acqadid};       
				   }
			},  
			error:function(){		 
                   if(!imgData[id].imgsrc){ 
				     if(num==2){
				     imgData[id]={imgsrc:'http://imageadv.ccb.com/dolphinfile/2016/01/5804_1.jpg',href:'http://creditcard.ccb.com/creditCard/shop.html'};    
					 }else if(num==3){
					 imgData[id]={imgsrc:'http://imageadv.ccb.com/dolphinfile/2016/01/5915_1.jpg',href:'http://fund.ccb.com/fund/index.html'};  
					 }else if(num==4){
					 imgData[id]={imgsrc:'http://imageadv.ccb.com/dolphinfile/2016/01/5916_1.jpg',href:'http://ehome.ccb.com/Channel/22678033'};  
					 }else if(num==5){
					 imgData[id]={imgsrc:'http://imageadv.ccb.com/dolphinfile/2015/12/5740_1.jpg',href:'http://www.ccb.com/cn/html1/office/ebank/dzb/subject/15/0116fqz/index1.html'};  
					 }else if(num==6){
					 imgData[id]={imgsrc:'http://imageadv.ccb.com/dolphinfile/2016/01/5880_2.jpg',href:'http://buy.ccb.com/'};  
					 }else if(num==7){
					 imgData[id]={imgsrc:'http://imageadv.ccb.com/dolphinfile/2015/12/5769_1.png',href:'http://finance.ccb.com/Channel/6424'};  
					 }
				   } 
			}, 
		    complete:function(){ 
                  if(imgData[id].imgsrc && !flag[id]){ 
				     $('.mnavL_info').eq(id).children().eq(0).after('<div class="mnavL_right fr"><div class="m_r_f_img2"><div><div><a href="'+imgData[id].href+'" target="_blank" class="AcqAdvClass" acqadid='+imgData[id].acqadid+'><img src="'+imgData[id].imgsrc+'"></a></div></div></div></div>');	
				    flag[id]=true;  
				  }			
				  	
			}
		});   
} 	
function menushowwithlazyload(obj1,obj2,cl,img){  
	var index,id,timer,divcreate;
	divcreate=false;
	$(obj1).hover(
	function(){ 
		id=$(obj1).index(this);  
		//id=$(obj1);
		if(!imgData[id].imgsrc){
		    InsertAdvs(id,img);  
		}   
		$(obj1).removeClass(cl); 
		$(this).addClass(cl);     
		hidecur();
		$(obj2).eq(id).stop(true,true).delay(400).slideDown(200, function(){});
		divcreate=true;
		index=id;  
	},function(){
		id=$(obj1).index(this);
		divcreate=false;
		hidecur();
		$(obj1).removeClass(cl);
	})
	
	$(obj2).hover(function(){divcreate=true;hidecur();},function(){id=$(obj2).index(this);divcreate=false;hidecur();});
	function hidecur(){
		clearTimeout(timer);
		if(index!=id){$(obj2).eq(index).stop(true,true).delay(50).fadeOut("fast", function(){});}
		timer=setTimeout(function(){
		if(!divcreate){
		$(obj2).eq(id).stop(true,true).delay(50).fadeOut("fast", function(){});	
		};
		},100);	
	}
}
menushowwithlazyload(".nav>ul>li",".mnavL","hover",".mnavL_left");
var footLocalUrl=location.hostname;
var footHostName=footLocalUrl.split(".")[0];
if(footHostName=="fjt"){$(".footer_links .Language_select a:eq(0)").text(decodeURI('%E7%AE%80%E4%BD%93'));
$(".footer_links .Language_select a:eq(0)").attr("href","http://www.ccb.com");
$(".footer_links .Language_select a:eq(1)").attr("href","http://en.ccb.com/en/home/indexv3.html");}
})
function insertIndexBigPictureAdv(){
   var indexBigPictureData;
   var link= getAdvUrl('10101','a','iframe','');
   $.ajax({  
	        async:true, 
			cache:false,
		    timeout:1500,
			type:"get",
			url:link+'&callback=jsonpCallback',
			dataType:"jsonp",
			jsonp:"callback10101", 
			jsonpCallback:"callback10101", 
			success:function (data){
			       indexBigPictureData=data;
			},   
			error:function(){	  
			   indexBigPictureData=[{largeImg: "http://image3.ccb.com/cn/img/mainMbs.jpg", smallImg: "http://image3.ccb.com/cn/img/mainMbsS.jpg",linkTo:"http://ebank.ccb.com/cn/ebank/personal/tdys/201306071370568804.html",acqadid:"website_mobilebanking_default_0"},{largeImg: "http://image3.ccb.com/cn/img/mainEcp.jpg", smallImg: "http://image3.ccb.com/cn/img/mainEcpS.jpg",linkTo:"http://buy.ccb.com/",acqadid:"website_ecp_default_0"},{}];
            }, 
		    complete:function(){ 
                 createBanner("D1pic1", "D1fBt", indexBigPictureData);
		         Qfast.add("widgets", {path: "http://www.ccb.com/cn/v3/js/terminator2.2.min.js", type: "js", requires: ["fx"]});Qfast(false, "widgets", function () {K.tabs({id: "fsD1",conId: "D1pic1",tabId: "D1fBt",tabTn: "a",conCn: ".fcon",auto: 1,effect: "fade",  eType: "mouseover",pageBt: true,bns: [".prev", ".next"],interval: 5000})})			
			}  
		});  

}
function queryIdParam(){
		$.ajax({
			
		    type:"get",
			url:'http://ebank.ccb.com/tran/WCCMainPlatV5?CCB_IBSVersion=V5&SERVLET_NAME=WCCMainPlatV5&TXCODE=NHYT01&&jsoncallback=jsonpCallback',
			dataType:"jsonp",
			jsonp:"jsoncallback",
			jsonpCallback:"jsonpCallback",
			success:function (data){
			       cstId=data.cstId;
				   if(cstId){
				      request(cstId);
				   }
			},
			error:function(){
			
			
			}
		   
		});
}
function createScript(ECIF_CUSTNO){  
			var srclink = 'https://mobile.ccb.com/cmccb/servlet/ccbNewClient?TXCODE=PP3037&DataDic=1&BRANCHID=999999999&ChanReqType=ESB_N&JSON={\"header\":{\"local\":\"zh_cn\",},\"request\":[{\"params\":{\"Cst_ID\":\"';
			srclink =srclink+ECIF_CUSTNO+'\",\"Cst_And_Empe_ReTpCd\":\"0970012\",\"Need_Back_Jsp\":\"1\"},\"txCode\":\"PP3037\"}]}';
			ele.src=srclink;
			ele.type='text/javascript';
			ele.language='javascript';   
		}
function request(ECIF_CUSTNO){
			ele = document.createElement('script');
			createScript(ECIF_CUSTNO);
			document.getElementsByTagName('head')[0].appendChild(ele);
		} 
function webcallback(data){   
	if(data.response[0].result.CST_EMP_REL_GRP.length==0){
	
		EmpID="";
	}else{
	    EmpID=data.response[0].result.CST_EMP_REL_GRP[0].EmpID;
	}
	
	Service_url="http://echat.ccb.com/colsvc3v/mservice.html?userType=22&IMType=01&managerId="+EmpID;
	if(EmpID){ 
	    $(".label_radio").removeClass("r_on");
		$(".kefu .zxkf_con").append('<label class="label_radio r_on"><input name="onlineService"   type="radio"/>专属客户经理</label><input type="hidden" name="onlineServiceRadio" value="'+Service_url+'"/>');
		 $(".label_radio").each(function(index){ 
         $(this).click(function(){
        $(this).addClass("r_on").siblings(".label_radio").removeClass("r_on"); 
		$(this).parent().find("input").removeAttr("checked");  
		$(this).children("input").attr("checked","checked");
		/**
        if(input_obj!=null){  
         $(this).children(input_obj).attr('checked','checked');
       }
		**/
       })
     })
	 }

}

//click栏目增加class并删除同胞
function Addclassname(obj,classname,input_obj){//click方法只判断一次遍历同胞
  this.obj = obj;
  if (typeof this.addc != 'function') {  
   Addclassname.prototype.addc=function(){
    $(this.obj).each(function(index){
      $(this).click(function(){
        $(this).addClass(classname).siblings(this.obj).removeClass(classname);
		$(this).parent().find("input").removeAttr("checked");
		$(this).children("input").attr("checked","checked");
		/**
        if(input_obj!=null){
         $(this).children(input_obj).attr('checked','checked');
       }
		**/
       })
     })
   }
 }
} 


function quickshow(obj1){
$(window).scroll(function(){
		if($(document).scrollTop()>500){
			$(obj1).show();
		}
		else{
			$(obj1).hide();
		}
	})
}
quickshow(".quick_operate")
//地图
function mapshow(obj1){
	//var id;
		$(obj1).hover(function(){
			//id=$(obj1).index(this);
		$(this).parent().find("span").show();
    },function(){
		$(this).parent().find("span").hide();
    })
	}
	
/**
 * banner自动生成方法，必须在文档流生成后并且轮播方法前调用
 * @param largeId   大图主div设置的ID
 * @param smallId   小图主div设置的ID
 * @param data  json数组，格式如下：
	var bannerData = [
		{largeImg: "images/1.jpg", smallImg: "images/5_5.jpg",linkTo:"#",acqadid:"123"},
		{largeImg: "images/2.jpg", smallImg: "images/4_4.jpg",linkTo:"#",acqadid:"456"},
		{largeImg: "images/3.jpg", smallImg: "images/6_6.jpg",linkTo:"#",acqadid:"789"},
		{largeImg: "images/3.jpg", smallImg: "images/6_6.jpg",linkTo:"#",acqadid:"012"},
		{}
	 ];
 */
function createBanner(largeId, smallId, data) {
	var bannerBigHTML="";
	var bannerSmallHTML="";
	for(var i = 0; i < data.length-1; i++){     
		bannerBigHTML+='<div  style="display:none" class="fcon"><div style="opacity: 1;background-image:url('+data[i].largeImg+'); background-position: 50% 0%; background-repeat:no-repeat no-repeat;"><a target="_blank" href="'+data[i].linkTo+'" class="AcqAdvClass" acqadid='+data[i].acqadid+'></a></div></div>';
		bannerSmallHTML+=' <a href="javascript:void(0)" hidefocus="true" target="_self"><span style="height: 0px;"><img src="'+data[i].smallImg+'"></span></a>';
	}
	$('#D1pic1').html(bannerBigHTML);
	$('#D1fBt').html(bannerSmallHTML); 
	var n=i;
	var margin_left = (n*95+(n-1)*11)/2
	var num = Math.round(margin_left);
	$("#fbg").css("margin-left","-"+num+"px");
	
}